function AutoCompleter(id)
{
	/**
	 * AutoCompleter attributes
	 */
	this.id    = id;
	this.items = [];
}

AutoCompleter.prototype.attach = function (elem)
{
	var html = '<select id="autoCompleter' + this.id + '">';
	
	jQuery.each(
		this.items, function (i, value)
		{
			html += '<option value="' + value + '">' + value + '</option>';
		});
	
	html += '</select>';
	
	$(elem).parent().append(html);
	
	$('#autoCompleter' + this.id).change(function ()
	{
		$(elem).val(this.val());
	});
}

AutoCompleter.prototype.push = function (item)
{
	var index = this.items.indexOf(item);
	
	if (index !== -1) {
		delete this.items[index];
	}
	
	this.items.push(item);
}

AutoCompleter.list = [];

jQuery.each(
	Action.Atoms, function (i, value)
	{
		AutoCompleter.list[value] = new AutoCompleter(value);
	});

// TODO : Add basic autocompletions for all Action.Atoms
